﻿/*----------------------------------------------------------------
  //Copyright (C) 2012 赵国伟
  //文件功能描述：商品搜索页
  //创建人：赵国伟
  //生成时间：2012/03/17 16:15:00
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Shopping.Common;
using Shopping.Model;
using Shopping.BLL;

public partial class Search : BasePage
{
    protected List<CategoryMenu> categories; //商品类别信息；
    protected URLManage bllUrl = new URLManage();

    protected QueryGoodsAsPage q; //分页查询对象；
    protected List<GoodsInfo> listOfGoods; //查询的结果信息；

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            q = new QueryGoodsAsPage(true); //初始化查询条件；
            CategoriesManage bllCategory = new CategoriesManage();
            categories = bllCategory.GetCategoryMenu(); //加载商品分类信息；

            GoodsManage bllGoods = new GoodsManage();

            if (q.Sorts == 0)
                q.Sorts = 7;
            q.Status = Status.正用.ToString();
            q.SaleStatus = GoodsSaleStatus.已上架.ToString();
            q.PageSize = 16;
            listOfGoods = bllGoods.QueryListAsPage(q); //查询商品；
        }
    }
}